{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "https://leetcode.com/problems/middle-of-the-linked-list\n",
    "\n",
    "\n",
    "Runtime: 28 ms, faster than 83.46% of Python3 online submissions for Middle of the Linked List.\n",
    "Memory Usage: 14.1 MB, less than 75.54% of Python3 online submissions for Middle of the Linked List.\n",
    "\n",
    "\n",
    "```python\n",
    "class Solution:\n",
    "    def middleNode(self, head: ListNode) -> ListNode:\n",
    "        #6:39\n",
    "        l = [head]\n",
    "        node = head\n",
    "        while node:\n",
    "            node = node.next\n",
    "            l.append(node)\n",
    "        middle = len(l)/2\n",
    "        if (middle.is_integer()):\n",
    "            return l[int(middle) - 1]\n",
    "        else:\n",
    "            return l[int(middle)]\n",
    "        #6:46\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
